import request from "@/utils/request";

// 手机验证码登录
export function listConfig(data) {
  return request({
    url: "/system/config/list",
    method: "post",
    data: data,
  });
}
// 获取地域
export function province(query) {
  return request({
    url: "/api/index/province",
    method: "get",
    params: query,
  });
}
// 获取大学列表
export function schoolList(data) {
  return request({
    url: "/api/index/schoolList",
    method: "post",
    data: data,
  });
}
// 获取院校类型
export function schoolType(query) {
  return request({
    url: "/api/index/school_type",
    method: "get",
    params: query,
  });
}
// 学校详情
export function schoolDetail(query) {
  return request({
    url: "/api/index/school_detail",
    method: "get",
    params: query,
  });
}
// 获取招生简讯
export function news(query) {
  return request({
    url: "/api/index/news",
    method: "get",
    params: query,
  });
}
// 学校开设专业
export function schoolMajor(query) {
  return request({
    url: "/api/index/school_major",
    method: "get",
    params: query,
  });
}
// 获取专业列表
export function majorList(query) {
  return request({
    url: "/api/index/majorList",
    method: "get",
    params: query,
  });
}
// 专业信息详情
export function majorDetail(query) {
  return request({
    url: "/api/index/major_detail",
    method: "get",
    params: query,
  });
}

// 获取一分一段列表
export function getScore(query) {
  return request({
    url: "/api/index/getScore",
    method: "post",
    data: query,
  });
}
// 获取批次线
export function getAdmission(query) {
  return request({
    url: "/api/index/getAdmission",
    method: "post",
    data: query,
  });
}

// 获取首页志愿填报推荐
export function getRecommendSchools(data) {
  console.log("config", data);
  return request({
    url: "/api/index/getRecommendSchools",
    method: "post",
    data: data,
  });
}

// 填写志愿
export function setVolunteer(data) {
  return request({
    url: "/api/user/setVolunteer",
    method: "post",
    data: data,
  });
}
// 招生简讯
export function getNews(data) {
  return request({
    url: "/api/index/news",
    method: "get",
    params: data,
    headers: {
      "content-type": "application/json",
    },
  });
}

// 微信扫码登录
export function getLoginUrl() {
  return request({
    url: "/api/wechat/getLoginUrl",
    method: "get",
  });
}
// 发送短信验证码
export function sendcode(data) {
  return request({
    url: "/api/sms/sendcode",
    method: "post",
    data: data,
  });
}
// 手机验证码登录
export function mobilelogin(data) {
  return request({
    url: "/api/user/mobilelogin",
    method: "post",
    data: data,
  });
}
// 微信扫码支付
export function wechatpay(data) {
  return request({
    url: "/api/wechat/pay",
    method: "post",
    data: data,
  });
}

// 支付宝扫码支付
export function alipaypay(data) {
  return request({
    url: "/api/alipay/pay",
    method: "post",
    data: data,
  });
}

// AI模型
export function chatAi(data) {
  return request({
    url: "/api/tongyi/chat",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/04/30
 * content：获取用户信息
 */
export function getUserInfo(data) {
  return request({
    url: "/api/user/getUserInfo",
    method: "get",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/04/30
 * content：对接ai模型
 */
export function getAiMessage(data) {
  return request({
    url: "/api/tongyi/chat",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/03
 * content：考情分析
 */
export function getExamInfo(data) {
  return request({
    url: "/api/index/cqVip",
    method: "get",
    params: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/07
 * content：获取学院招生计划
 */
export function getEnrollmentPlan(data) {
  return request({
    url: "/api/index/plan",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/07
 * content：获取历年分数线
 */
export function getEnrollmentFraction(data) {
  return request({
    url: "/api/index/score",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/07
 * content：获取历年分数线
 */
export function getRecommendSchoolsMajor(data) {
  return request({
    url: "/api/index/getRecommendSchoolsMajor",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/07
 * content：获取历年分数线
 */
export function addVoluntary(data) {
  return request({
    url: "/api/index/voluntary",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/07
 * content：获取我的志愿
 */
export function myVoluntary(data) {
  return request({
    url: "/api/index/myVoluntary",
    method: "post",
    data: data,
    headers: {
      skipRepeatSubmit: true, // 添加跳过重复提交检查的标识
    },
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/08
 * content：删除我的志愿 /api/index/delvoluntary
 */
export function deleteMyVoluntary(data) {
  return request({
    url: "/api/index/delvoluntary",
    method: "get",
    params: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/12
 * content：一键填报
 */
export function getRecommendSchoolsVoluntarty(data) {
  return request({
    url: "/api/index/getRecommendSchoolsVoluntarty",
    method: "post",
    data: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/12
 * content：一键填报
 */
export function getMyScoreLevel(data) {
  return request({
    url: "/api/index/getScoreNum",
    method: "get",
    params: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/12
 * content：一键填报
 */
export function getVipHistory(data) {
  return request({
    url: "/api/user/vipHistory",
    method: "get",
    params: data,
  });
}

/*
 * author：Gengbaodada
 * create by date：2025/05/12
 * content：一键填报
 */
export function getCountVoluntary(data) {
  return request({
    url: "/api/index/countVoluntary",
    method: "get",
    params: data,
  });
}
